Optimal. Leaf size=140 \[ -\frac {4 a^4 (A-i B) \tan (c+d x)}{d}-\frac {8 a^4 (B+i A) \log (\cos (c+d x))}{d}+8 a^4 x (A-i B)+\frac {(B+i A) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\frac {a (B+i A) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3527, 3478, 3477, 3475} \[ -\frac {4 a^4 (A-i B) \tan (c+d x)}{d}+\frac {(B+i A) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-\frac {8 a^4 (B+i A) \log (\cos (c+d x))}{d}+8 a^4 x (A-i B)+\frac {a (B+i A) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3477
Rule 3478
Rule 3527
Rubi steps
\begin {align*} \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx &=\frac {B (a+i a \tan (c+d x))^4}{4 d}-(-A+i B) \int (a+i a \tan (c+d x))^4 \, dx\\ &=\frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+(2 a (A-i B)) \int (a+i a \tan (c+d x))^3 \, dx\\ &=\frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+\frac {(i A+B) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (4 a^2 (A-i B)\right ) \int (a+i a \tan (c+d x))^2 \, dx\\ &=8 a^4 (A-i B) x-\frac {4 a^4 (A-i B) \tan (c+d x)}{d}+\frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+\frac {(i A+B) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (8 a^4 (i A+B)\right ) \int \tan (c+d x) \, dx\\ &=8 a^4 (A-i B) x-\frac {8 a^4 (i A+B) \log (\cos (c+d x))}{d}-\frac {4 a^4 (A-i B) \tan (c+d x)}{d}+\frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+\frac {(i A+B) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 3.70, size = 448, normalized size = 3.20 \[ \frac {a^4 \sec (c) \sec ^4(c+d x) \left (3 \cos (c) \left ((-6 B-6 i A) \log \left (\cos ^2(c+d x)\right )+12 A d x-4 i A-12 i B d x-7 B\right )+6 \cos (c+2 d x) \left ((-2 B-2 i A) \log \left (\cos ^2(c+d x)\right )+4 A d x-i A-4 i B d x-2 B\right )-32 A \sin (c+2 d x)+12 A \sin (3 c+2 d x)-11 A \sin (3 c+4 d x)-6 i A \cos (3 c+2 d x)+24 A d x \cos (3 c+2 d x)+6 A d x \cos (3 c+4 d x)+6 A d x \cos (5 c+4 d x)-12 i A \cos (3 c+2 d x) \log \left (\cos ^2(c+d x)\right )-3 i A \cos (3 c+4 d x) \log \left (\cos ^2(c+d x)\right )-3 i A \cos (5 c+4 d x) \log \left (\cos ^2(c+d x)\right )+33 A \sin (c)+38 i B \sin (c+2 d x)-18 i B \sin (3 c+2 d x)+14 i B \sin (3 c+4 d x)-12 B \cos (3 c+2 d x)-24 i B d x \cos (3 c+2 d x)-6 i B d x \cos (3 c+4 d x)-6 i B d x \cos (5 c+4 d x)-12 B \cos (3 c+2 d x) \log \left (\cos ^2(c+d x)\right )-3 B \cos (3 c+4 d x) \log \left (\cos ^2(c+d x)\right )-3 B \cos (5 c+4 d x) \log \left (\cos ^2(c+d x)\right )-42 i B \sin (c)\right )}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.48, size = 230, normalized size = 1.64 \[ \frac {{\left (-72 i \, A - 120 \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (-180 i \, A - 252 \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (-152 i \, A - 200 \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (-44 i \, A - 56 \, B\right )} a^{4} + {\left ({\left (-24 i \, A - 24 \, B\right )} a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + {\left (-96 i \, A - 96 \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (-144 i \, A - 144 \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (-96 i \, A - 96 \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (-24 i \, A - 24 \, B\right )} a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.75, size = 408, normalized size = 2.91 \[ \frac {-24 i \, A a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 24 \, B a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 96 i \, A a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 96 \, B a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 144 i \, A a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 144 \, B a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 96 i \, A a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 96 \, B a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 72 i \, A a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} - 120 \, B a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} - 180 i \, A a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} - 252 \, B a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} - 152 i \, A a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} - 200 \, B a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} - 24 i \, A a^{4} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 24 \, B a^{4} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 44 i \, A a^{4} - 56 \, B a^{4}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 194, normalized size = 1.39 \[ -\frac {4 i a^{4} B \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {a^{4} B \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}-\frac {2 i a^{4} A \left (\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {a^{4} A \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {8 i a^{4} B \tan \left (d x +c \right )}{d}-\frac {7 a^{4} B \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {7 A \,a^{4} \tan \left (d x +c \right )}{d}+\frac {4 i a^{4} A \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {4 a^{4} B \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {8 i a^{4} B \arctan \left (\tan \left (d x +c \right )\right )}{d}+\frac {8 a^{4} A \arctan \left (\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.63, size = 113, normalized size = 0.81 \[ \frac {3 \, B a^{4} \tan \left (d x + c\right )^{4} + 4 \, {\left (A - 4 i \, B\right )} a^{4} \tan \left (d x + c\right )^{3} + {\left (-24 i \, A - 42 \, B\right )} a^{4} \tan \left (d x + c\right )^{2} + 96 \, {\left (d x + c\right )} {\left (A - i \, B\right )} a^{4} + 12 \, {\left (4 i \, A + 4 \, B\right )} a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 12 \, {\left (7 \, A - 8 i \, B\right )} a^{4} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.12, size = 181, normalized size = 1.29 \[ \frac {B\,a^4\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (8\,B\,a^4+A\,a^4\,8{}\mathrm {i}\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {a^4\,\left (A-B\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}+\frac {B\,a^4}{2}+\frac {a^4\,\left (3\,B+A\,1{}\mathrm {i}\right )}{2}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (-3\,a^4\,\left (A-B\,1{}\mathrm {i}\right )+a^4\,\left (B+A\,3{}\mathrm {i}\right )\,1{}\mathrm {i}+B\,a^4\,1{}\mathrm {i}+a^4\,\left (3\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (\frac {B\,a^4\,1{}\mathrm {i}}{3}+\frac {a^4\,\left (3\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.98, size = 238, normalized size = 1.70 \[ - \frac {8 i a^{4} \left (A - i B\right ) \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {44 i A a^{4} + 56 B a^{4} + \left (152 i A a^{4} e^{2 i c} + 200 B a^{4} e^{2 i c}\right ) e^{2 i d x} + \left (180 i A a^{4} e^{4 i c} + 252 B a^{4} e^{4 i c}\right ) e^{4 i d x} + \left (72 i A a^{4} e^{6 i c} + 120 B a^{4} e^{6 i c}\right ) e^{6 i d x}}{- 3 d e^{8 i c} e^{8 i d x} - 12 d e^{6 i c} e^{6 i d x} - 18 d e^{4 i c} e^{4 i d x} - 12 d e^{2 i c} e^{2 i d x} - 3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________